package thread;

public class SleepDemo2 {
    public static void main(String[] args) {
        Thread lin=new Thread("Lin"){
            @Override
            public void run() {
                System.out.println(this.getName()+": 睡个美容觉...");
                try {
                    Thread.sleep(5000000);
                } catch (InterruptedException e) {
                    System.out.println(getName()+"干嘛呢干嘛呢干嘛呢干嘛呢！");
                }
            }
        };

        Thread huang=new Thread("Huang"){
            @Override
            public void run() {
                System.out.println(getName()+": 开始砸墙，小锤40，大锤80！");
                for(int n=5;n>0;n--){
                    System.out.println("大锤80！");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println(getName()+":大哥，搞定！");
                lin.interrupt();
            }
        };
            lin.start();
            huang.start();

    }
}
